package com.wyq.new_springboot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wyq.new_springboot.entity.TUser;
import com.wyq.new_springboot.mapper.TUserMapper;
import com.wyq.new_springboot.service.ITUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr Wei
 * @since 2021-03-24
 */
@Service
public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements ITUserService {

    @Autowired
    TUserMapper tUserMapper;
    @Override
    public void insert(TUser tUser) {
        tUserMapper.insert(tUser);
    }

    @Override
    public List<TUser> selectByMap(Map map) {
        return (List<TUser>) tUserMapper.selectByMap(map);
    }

    @Override
    public List<TUser> selectByColumn(String column,String value) {
        QueryWrapper<TUser> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq(column,value);
        return tUserMapper.selectList(queryWrapper);
    }
}
